package com.hm.cms.domain;

import java.util.Date;

import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.hm.cms.auto.su.BaseDomain;
import com.hm.cms.auto.su.R;

import lombok.Getter;
import lombok.Setter;

/**
 * @author shishun.wang
 * @date 2017年10月31日 下午10:41:29
 * @version 1.0
 * @describe
 */
@Setter
@Getter
@Document(collection = R.Database.prefix + "VISIT_IP_STATISTICS")
@CompoundIndexes({ @CompoundIndex(name = "ip", def = "{'ip': 1}"),
		@CompoundIndex(name = "ip,visit_date", def = "{'ip': 1, 'visit_date': 1}") })
public class VisitIpStatisticsDomain extends BaseDomain {

	private static final long serialVersionUID = 1L;

	/**
	 * 访问ip地址
	 */
	private String ip;

	/**
	 * 请求地址
	 */
	@Field(value = "req_uri")
	private String reqUri;

	/**
	 * 访问第一时间
	 */
	@Field(value = "visit_time")
	private Date visitTime;

	/**
	 * 访问时间，精确到天
	 */
	@Field(value = "visit_date")
	private String visitDate;

	/**
	 * 单日访问数据量记录
	 */
	@Field(value = "access_count")
	private Integer accessCount;
}
